package bilibili;

import java.util.Scanner;

/**
 * @author xizizzz
 * @description: TODO
 * @date 2021-9-13下午 07:45
 */
public class Test3 {
    public static void main(String[] args) {
        final Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] row = new int[500000];
        int[] col = new int[500000];
        while (n-- > 0) {
            final int x = sc.nextInt();
            final int y = sc.nextInt();
            row[x]++;
            col[y]++;
        }
        int max = 0;
        for (int i = 0; i < row.length; i++) {
            max = Math.max(row[i], max);
        }
        for (int i = 0; i < col.length; i++) {
            max = Math.max(col[i], max);
        }
        System.out.println(max);
    }

}
